GXInitialize
QuickDraw GX sends theGXInitialize
message at the start of a new printing job. You can override theGXInitialize
message to perform any initialization your message handler needs to carry out its tasks. Your override of theGXInitialize
message must match the following formal declaration:
OSErr MyInitialize (void);
- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
QuickDraw GX sends theGXInitialize
message at the start of a new printing job, just after the application has called theGXNewJob
function.You can override the
GXInitialize
message to perform any necessary initialization and to allocate storage for your extension or driver.GXInitialize
is the first message a message handler receives after it is loaded into the message chain. If you need to allocate storage for global data in your override ofGXInitialize
, you need to call theNewHandle
function and store the handle by calling theSetMessageHandlerInstanceContext
function. Or you can call theNewMessageGlobals
function to set up a globals environment to access so that you can access the global data. This stores the handle into the context for any other messages that you override. .The default implementation of the
GXInitialize
message allocates memory needed by QuickDraw GX in its default implementation of the printing messages.SPECIAL CONSIDERATIONS
You never send theGXInitialize
message yourself.You never forward the
GXInitialize
message.RESULT CODES
gxSegmentLoadFailedErr A required code segment could not be found, or there was not enough memory to load it. gxPrUserAbortErr The user has canceled printing. SEE ALSO
You can find examples of overrides of theGXInitialize
message in Listing 2-6 on page 2-16 in the chapter "Printing Extensions" and in Listing 3-4 on page 3-24 in the chapter "Printer Drivers."The
GXNewJob
function is described in Inside Macintosh: QuickDraw GX Printing.The
NewHandle
function is described in Inside Macintosh: Memory. TheNewMessageGlobals
function is described in the chapter "Message Manager" in Inside Macintosh: QuickDraw GX Environment and Utilities.The
SetMessageHandlerInstanceContext
function is described in Inside Macintosh: Processes.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help